<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>补丁管理 - ROAS资源管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
body { 
margin:0;
}
.STYLE8 {color: #FF0000}
-->
</style>
</head>

<body margin=0>

<table width="100%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="28" class="STYLE7">系统管理 &gt;所属城市</td>
  </tr>
  <tr>
    <td valign="top"><table width="50%" align="center" >
      <tr>
        <td height="25" colspan="2" bordercolor="#000000" bgcolor="#1C94C4"><div align="center" class="STYLE1">所属城市</div></td>
      </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;城市添加：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input type="text" id="cityname" />
          <input type="button" name="Submit2" value="添加" onclick="addCity()" />
        </span></td>
      </tr>
	   <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;所属城市：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="cities">
         
        </select>          </td>
      </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#1C94C4"><div align="center" class="STYLE6">
            <form action="" method="post" name="form1" id="form1">
              <label></label>
            </form>
        </div></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script language="javascript">
$.get("../user/fetchcities",{},function(json){
	var opStr = "";
	for(var i = 0,l = json.length ; i < l ; i++)
	{
		opStr += "<option>" + json[i].CityName + "</option>";
	}
	$("#cities").empty().append(opStr);
});

function addCity()
{
	$.post("../user/addcity",{
		cityname:$("#cityname").val()
	},function(json){
		alert("添加成功！");
		var opStr = "";
		for(var i = 0,l = json.length ; i < l ; i++)
		{
			opStr += "<option>" + json[i].CityName + "</option>";
		}
		$("#cities").empty().append(opStr);
	});
}
</script>
</body>
</html>
